
function print(value){
	console.log(value);
}

function changeUrl(value){
// console.log(value);

	switch(value.id){
		case "fang":
		//console.log("方形");
		back_everyObj("mubu").src="fangxing.html";
		break;
		case "zhi":
		// console.log("直圈");
		back_everyObj("mubu").src="zhiquan.html";
		break;

	}
	
	

}

//获取span元素对象
function deal_obj(obj_id,value){
	document.getElementById(obj_id).textContent=value;
}
// 获取任何一个对象
function back_everyObj(obj_id){
	return document.getElementById(obj_id);
}
//根据体积计算重量的函数
function deal_fangV(){

	let tiji_value=Number(document.getElementById("tiji").value); //获取体积
	
	let duan_zhiliang=(tiji_value*0.00000785).toFixed(1); //锻件的质量

	let liao_zhiliang=(tiji_value*0.00000785*0.03).toFixed(1)//料芯的重量=锻件的重量*0.03

	let xia_zhiliang=Number(tiji_value*0.00000785*1.06).toFixed(1);

	let xiao_zhiliang=Number(tiji_value*0.00000785*1.06*1.03).toFixed(1);

	//定义需要显示的内部质量id

	let duan_id="duan_zhiliang",liao_id="liao_zhiliang",xia_id="xia_zhiliang",xiao_id="xiao_zhiliang";

	deal_obj(duan_id,duan_zhiliang) //内部锻件质量 显示处理

	deal_obj(liao_id,liao_zhiliang) //内部料芯质量 显示处理

	deal_obj(xia_id,xia_zhiliang) //内部下料质量 显示处理

	deal_obj(xiao_id,xiao_zhiliang) //内部消耗质量 显示处理

	let duobao_value=Number(document.getElementById("duobao").value);//获取多报的百分比值

	//多报的锻件质量
	let duoduan_zhiliang=(Number(duan_zhiliang)*(1+duobao_value)).toFixed(1);

	let duoliao_zhiliang=(Number(duoduan_zhiliang)*0.03).toFixed(1);

	let duoxia_zhiliang=(Number(duoduan_zhiliang)*1.06).toFixed(1);

	let duoxiao_zhiliang=(Number(duoxia_zhiliang)*1.03).toFixed(1);

	let duoduan_id="duoduan_zhiliang",duoliao_id="duoliao_zhiliang",duoxia_id="duoxia_zhiliang",duoxiao_id="duoxiao_zhiliang"

	deal_obj(duoduan_id,duoduan_zhiliang); //多报外部锻件质量 显示处理

	deal_obj(duoliao_id,duoliao_zhiliang); //多报外部料芯质量 显示处理

	deal_obj(duoxia_id,duoxia_zhiliang); //多报外部下料质量 显示处理

	deal_obj(duoxiao_id,duoxiao_zhiliang); //多报外部消耗质量 显示处理

}

//清除input的数据
function delete_data(){

	var delete_obj1="tiji"; //获取需要清除input的id

	back_everyObj(delete_obj1).value="";


}